package main;

import javax.media.j3d.*;

import com.sun.j3d.loaders.vrml97.VrmlLoader;
import com.sun.j3d.loaders.Scene;

public class vrmlLoad extends BranchGroup {

    public vrmlLoad(String filename) {
        BranchGroup obj = new BranchGroup();
        VrmlLoader loader = new VrmlLoader();
        Scene s = null;
        try {
            s = loader.load(filename);

        } catch (Exception e) {
            System.err.println(e);
            System.exit(1);
        }
        obj.addChild(s.getSceneGroup());
        //System.out.println("* Named Objects in VRML file: \n" + namedObjects);
        this.addChild(obj);
    }
}
